package com.itheima.leyou.controller;

import com.itheima.leyou.entity.User;
import com.itheima.leyou.mapper.UserMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value="/user")//映射
public class UserController {
    @Resource
    public UserMapper userMapper;

    @ResponseBody
    @RequestMapping(value="/getUserParams")
    public User getUserParams(){
        return userMapper.getUserParam(28,"zhangsan");
    }

    @ResponseBody
    @RequestMapping(value="/getUser")
    public List<User> getUser(){
        User user = new User();
//        user.setId(31);
//        user.setUsername("1121112");
        return userMapper.getUser(user);
    }
}
